//
//  BMHomeMenuTableViewCell.m
//  EnjogFood
//
//  Created by Ashlike on 04/06/2018.
//  Copyright © 2018 wf. All rights reserved.
//

#import "BMHomeMenuTableViewCell.h"
@interface BMHomeMenuTableViewCell()
@property (nonatomic, strong) UIView *containerView;

@end
@implementation BMHomeMenuTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
        self.backgroundColor = RGBCOLOR(0xf5f9f9);
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)initUI{
    UIView *containerView = [[UIView alloc] init];
    [self.contentView addSubview:containerView];
    containerView.backgroundColor = [UIColor whiteColor];
    containerView.layer.borderWidth = 1;
    containerView.layer.borderColor = [UIColor grayColor].CGColor;
    // 给该容器添加布局代码
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(66);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(300);
    }];
    // 为该容器添加宫格View
    for (int i = 0; i < 4; i++) {
        UIView *view = [[UIView alloc] init];
        view.backgroundColor = [UIColor redColor];
        [containerView addSubview:view];
    }
    // 执行九宫格布局
    [containerView.subviews mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedItemLength:60 leadSpacing:20 tailSpacing:20];
    
}

- (void)setObject:(NSArray *)items{
    //模拟真实数据
//    NSArray *titleArray = @[@"教育培训",@"美容美体",@"租房",@"松鼠贷"];
//    NSArray *imageArray = @[@"Group",@"Group",@"Group",@"Group"];
}

@end
